package com.situ.feemanagement.controller;

import com.situ.feemanagement.pojo.vo.EChartsVO;
import com.situ.feemanagement.pojo.vo.TotalVO;
import com.situ.feemanagement.service.IEchartsService;
import com.situ.feemanagement.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/echarts")
public class EchartsController {

    @Autowired
    private IEchartsService echartsService;

    @GetMapping("/selectEarning")
    public Result selectEarning() {
        List<EChartsVO> list = echartsService.selectEarning();
        return Result.ok(list);
    }

    @GetMapping("/selectTotalCount")
    public Result selectTotalCount() {
        TotalVO totalVO = echartsService.selectTotalCount();
        return Result.ok(totalVO);
    }

    @GetMapping("/selectCategoryCount")
    public Result selectCategoryCount() {
        Map<String, Object> map = echartsService.selectCategoryCount();
        return Result.ok(map);
    }

    @GetMapping("/selectInventoryCount")
    public Result selectInventoryCount() {
        List<EChartsVO> list = echartsService.selectInventoryCount();
        return Result.ok(list);
    }
}
